package org.phantom.securityframework.local;

import java.util.List;

import org.apache.shiro.subject.Subject;
import org.phantom.securityframework.api.Account;
import org.phantom.securityframework.api.Permission;
import org.springframework.stereotype.Service;

import org.phantom.securityframework.auth.realm.SubjectPermissionRealm;

@Service
public class AccountPermissionRealm implements SubjectPermissionRealm{

	
	@Override
	public List<Permission> getSubjectPermission(Subject subject) {
		if(subject==null)return null;
		
		Account account = (Account) subject;
		return account.getPermissions();
	}

}
